home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / September 96 / Re Dragging out of a floating < prev    next >
Encoding:
Internet Message Format  |  1996-09-19  |  1.5 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Dragging out of a floating palette.
  2. Sent:        9/10/96 10:45 AM
  3. Received:    9/10/96 10:45 AM
  4. From:        Mary Boetcher <boetche1@apple.com>
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List
  7.  
  8.  
  9. >I tried making the floating window FW_MDraggable and adding a drag 
  10. >command, but it needs a selection.
  11. Not only that, but the selection needs a content object. Is there no end 
  12. to this?!?
  13.  
  14. The selection and its content specify what data is to be written to the 
  15. storage unit for a drag (or copy) operation. FW_CDragCommand::BeginDrag 
  16. makes this call to externalize the selected data:
  17.   dataInterchange->ExternalizeData(ev, 
  18. fSelection->GetSelectedContent(ev), etc.);
  19.  
  20. In your selection subclass, you can either create a content object in the 
  21. constructor and keep it around all the time, or you can create one on the 
  22. fly in the selection's GetSelectedContent method. The methods you must 
  23. override in your selection subclass are SelectAll, ClearSelection, 
  24. CloseSelection, IsEmpty, and GetSelectedContent. For your palette, the 
  25. first three methods don't need to do anything. IsEmpty just returns false.
  26.  
  27. Create the selection object in your part's Initialize method. Then create 
  28. the palette's presentation, passing it the selection object.
  29.  
  30. The selection method CreateSelectionOutline is called by 
  31. FW_CDragCommand::CreateDragShape, so you can override it to return a 
  32. shape matching the selection item in the palette. 
  33.  
  34. Hope this helps,
  35.  
  36. Mary Boetcher
  37. ODF Person